package ru.evga.inse.core.exception;

public class UnlocaliseMessage
{
    private static final Object [] EMPTY_ARGS = new Object[0];
    private String m_strErrorId;
    private Object [] m_aArgs = null;

    private UnlocaliseMessage()
    {
    }

    public static UnlocaliseMessage createUnlocaliseMessage(String strErrorId)
    {
        return createUnlocaliseMessage(strErrorId, EMPTY_ARGS);
    }

    public static UnlocaliseMessage createUnlocaliseMessage(String strErrorId, Object arg)
    {
        return createUnlocaliseMessage(strErrorId, new Object[]
        {
            arg
        });
    }

    public static UnlocaliseMessage createUnlocaliseMessage(String strErrorId, Object [] aArgs)
    {
        UnlocaliseMessage message = new UnlocaliseMessage();
        message.m_strErrorId = strErrorId;
        message.m_aArgs = aArgs;
        return message;
    }

    public String getMessageId()
    {
        return m_strErrorId;
    }

    public Object [] getArguments()
    {
        return m_aArgs == null ? EMPTY_ARGS : m_aArgs;
    }
}
